import axios from '@/libs/api.request'

export const getUserList = () => {

    return axios.request({
        url: '/api/admin/users',
        method: 'get'
    })
}


export const login = ({ userName, password }) => {
    const data = {
        userName,
        password
    }
    return axios.request({
        url: 'login',
        data,
        method: 'post'
    })
}

export const getUserInfo = (token) => {
    return axios.request({
        url: 'get_info',
        params: {
            token
        },
        method: 'get'
    })
}

export const logout = (token) => {
    return axios.request({
        url: 'logout',
        method: 'post'
    })
}



export const restoreTrash = msg_id => {
    return axios.request({
        url: 'message/restore',
        method: 'post',
        data: {
            msg_id
        }
    })
}